import Login from '@/pages/Login'

/**
 * 所有路由配置的数组
 * * 一级路由前面需要有 /，二级路由不要有 /
 * * 路由路径中单词都是小写的
 */
export default [
  {
    path: '/',
    redirect: '/login'
  }, {
    path: '/login',
    component: Login
  }, {
    path: '/home',
    component: () => import('@/pages/Home'),
    children: [{ // 子路由
      path: '/',
      redirect: 'dashboard'
    }, {
      path: 'dashboard',
      component: () => import('@/pages/Dashboard')
    }, {
      path: 'setting',
      component: () => import('@/pages/Setting')
    }, {
      path: '*',
      component: () => import('@/pages/Empty')
    }]
  }, {
    path: '*', // 会匹配所有路径，应该放在最后，通常用于客户端 404 错误
    component: () => import('@/pages/Empty') // 路由懒加载
  }
]